import request from '@/utils/request'

/**
 * 新增部门
 * @param {code,manager,naem,pid} data
 */
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}
/**
 * 查询部门列表
 * @param
 */
export function getDepartments() {
  return request({
    url: '/company/department'
  })
}
/**
 * 修改部门列表
 * @param
 */
export function updateDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
/**
 * 删除部门列表
 * @param
 */
export function delDepartments(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}
/**
 * 查询部门详情
 * @param
 */
export function getDepartmentDetial(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'get'
  })
}
